fix: add timeout mechanism for OpenRouter stream hanging issue #6138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #6137 where Roo Code gets stuck with a spinning indicator when using OpenRouter with Claude Sonnet 4.
Problem
Users were experiencing indefinite hanging when using OpenRouter as their API provider. The application would show a spinning indicator and never proceed after displaying the file list.
Solution
Added timeout mechanisms to prevent OpenRouter streams from hanging:
Task.tsthat prevents the first chunk await from hanging indefinitelyOpenRouterHandlerto detect when no data has been received for an extended periodChanges
src/core/task/Task.tsto add timeout logic for OpenRouter first chunksrc/api/providers/openrouter.tsto add stream timeout monitoringTesting
Fixes #6137
Important
Adds timeout mechanisms in
Task.tsandopenrouter.tsto prevent OpenRouter stream hanging, with clear error messages for users.Task.tsto prevent indefinite hanging with OpenRouter.OpenRouterHandlerinopenrouter.ts.Task.ts: Adds timeout logic for OpenRouter's first chunk.openrouter.ts: Adds stream timeout monitoring.This description was created by
for 3312739. You can customize this summary. It will automatically update as commits are pushed.